www.gusucode.com > 落叶冰点万能企业网站内容管理系统 V9.1 > 落叶冰点万能企业网站内容管理系统 V9.1\code\admin\inc\inc_sys.asp
<% '************************************************************** ' 新动软网站管理系统 ' 官方网站: http://www.aspcpu.com ' 系统作者: 阮丁远(网名:天下程序) ' Copyright 新动软网站管理系统 版权所有 '************************************************************** %> <% if havessss="" then havessss=1 '************************************************* '函数名:gotTopicss '作 用:截字符串,汉字一个算两个字符,英文算一个字符 '参 数:str ----原字符串 ' strlen ----截取长度 '返回值:截取后的字符串 '************************************************* function gotTopicssd(str,strlen) if isnull(str) or str="" then gotTopicss="" exit function end if 'dim l,t,c, i str=replace(replace(replace(replace(str," "," "),""",chr(34)),">",">"),"<","<") l=len(str) t=0 for i=1 to l c=Abs(Asc(Mid(str,i,1))) if c>255 then t=t+2 else t=t+1 end if if t>=strlen then gotTopicss=left(str,i) & "…" exit for else gotTopicss=str end if next gotTopicssd=replace(replace(replace(replace(gotTopicssd," "," "),chr(34),"""),">",">"),"<","<") end function '************************************************* '函数名:gotTopicss '作 用:截字符串,汉字一个算两个字符,英文算一个字符 '参 数:str ----原字符串 ' strlen ----截取长度 '返回值:截取后的字符串 '************************************************* function gotTopicssd(str,strlen) if isnull(str) or str="" then gotTopicss="" exit function end if 'dim l,t,c, i str=replace(replace(replace(replace(str," "," "),""",chr(34)),">",">"),"<","<") l=len(str) t=0 for i=1 to l c=Abs(Asc(Mid(str,i,1))) if c>255 then t=t+2 else t=t+1 end if if t>=strlen then gotTopicss=left(str,i) & "…" exit for else gotTopicss=str end if next gotTopicssd=replace(replace(replace(replace(gotTopicssd," "," "),chr(34),"""),">",">"),"<","<") end function '************************************************* '函数名:NogotTopicss '作 用:截字符串,汉字一个算两个字符,英文算一个字符,结尾没有三个点 '参 数:str ----原字符串 ' strlen ----截取长度 '返回值:截取后的字符串 '************************************************* function NogotTopicssd(str,strlen) if str="" then NogotTopicss="" exit function end if dim l,t,c, i str=replace(replace(replace(replace(str," "," "),""",chr(34)),">",">"),"<","<") l=len(str) t=0 for i=1 to l c=Abs(Asc(Mid(str,i,1))) if c>255 then t=t+2 else t=t+1 end if if t>=strlen then NogotTopicss=left(str,i) exit for else NogotTopicss=str end if next NogotTopicssd=replace(replace(replace(replace(NogotTopicss," "," "),chr(34),"""),">",">"),"<","<") end function '*********************************************** '函数名:JoinCharss '作 用:向地址中加入 ? 或 & '参 数:strUrl ----网址 '返回值:加了 ? 或 & 的网址 '*********************************************** function JoinCharssd(strUrl) if strUrl="" then JoinCharssd="" exit function end if if InStr(strUrl,"?")<len(strUrl) then if InStr(strUrl,"?")>1 then if InStr(strUrl,"&")<len(strUrl) then JoinCharssd=strUrl & "&" else JoinCharssd=strUrl end if else JoinCharssd=strUrl & "?" end if else JoinCharssd=strUrl end if end function '*********************************************** '过程名:showpagesstt '作 用:显示“上一页 下一页”等信息 '参 数:sfilename ----链接地址 ' totalnumber ----总数量 ' maxperpage ----每页数量 ' ShowTotal ----是否显示总数量 ' ShowAllPages ---是否用下拉列表显示所有页面以供跳转。有某些页面不能使用,否则会出现JS错误。 ' strUnit ----计数单位 ' CurrentPage -----现在的页数 '........................................调用页面需要定义的 ' CurrentPage=replacebadchar(request("page")) ' if CurrentPage="" then ' CurrentPage=1 ' else if not IsNumeric(CurrentPage) then ' CurrentPage=1 ' else if int(CurrentPage)<=0 then ' CurrentPage=1 ' else ' CurrentPage=replacebadchar(request("page")) ' end if ' end if ' end if ' strFileName="" ' maxperpage=10 ' rs.pagesize=MaxPerpage ' totalnumber=rs.recordcount ' if totalnumber mod maxperpage=0 then ' MaxPage= totalnumber \ MaxPerpage ' else ' MaxPage= totalnumber \ MaxPerpage+1 ' end if ' if int(CurrentPage)>int(MaxPage) then ' CurrentPage=MaxPage ' else ' CurrentPage=CurrentPage ' end if ' Rs.absolutepage=CurrentPage ' for ni=1 to MaxPerpage ' if rs.eof then exit for ' call showpagess(strFileName,totalnumber,MaxPerPage,flase,true,"条") //调用语句 ' ' ' '*********************************************** sub showpagessttd(sfilename,totalnumber,maxperpage,ShowTotal,ShowAllPages,strUnit,CurrentPage) 'dim n, i,strTemp,strUrl if totalnumber mod maxperpage=0 then n= totalnumber \ maxperpage else n= totalnumber \ maxperpage+1 end if strTemp= "<table align='center' class=maintext><form name='showpagesss' method='post' action='" & sfilename & "'><tr><td>" if ShowTotal=true then strTemp=strTemp & "共 <b>" & totalnumber & "</b> " & strUnit & " " end if strUrl=JoinCharss(sfilename) if CurrentPage<2 then strTemp=strTemp & "首页 上一页 " else strTemp=strTemp & "<a class=maintext href='" & strUrl & "page=1"&"&fid="&request("fid")&"'>首页</a> " strTemp=strTemp & "<a class=maintext href='" & strUrl & "page=" & (CurrentPage-1) &"&fid="&request("fid") & "'>上一页</a> " end if if n-currentpage<1 then strTemp=strTemp & "下一页 尾页" else strTemp=strTemp & "<a class=maintext href='" & strUrl & "page=" & (CurrentPage+1) &"&fid="&request("fid")&"'>下一页</a> " strTemp=strTemp & "<a class=maintext href='" & strUrl & "page=" & n &"&fid="&request("fid")&" '>尾页</a>" end if strTemp=strTemp & " 页次:<strong><font color=red>" & CurrentPage & "</font>/" & n & "</strong>页 " strTemp=strTemp & " <b>" & maxperpage & "</b>" & strUnit & "/页" if ShowAllPages=True then strTemp=strTemp & " 转到:<select name='page' size='1' onchange='javascript:submit()'>" for i = 1 to n strTemp=strTemp & "<option value='" & i & "'" if cint(CurrentPage)=cint(i) then strTemp=strTemp & " selected " strTemp=strTemp & ">第" & i & "页</option>" next strTemp=strTemp & "</select>" end if strTemp=strTemp & "</td></tr><input type=hidden name=fid value="&request("fid")&"></form></table>" response.write strTemp end sub '*********************************************** '过程名:showpagess '作 用:显示“上一页 下一页”等信息 '参 数:sfilename ----链接地址 ' totalnumber ----总数量 ' maxperpage ----每页数量 ' ShowTotal ----是否显示总数量 ' ShowAllPages ---是否用下拉列表显示所有页面以供跳转。有某些页面不能使用,否则会出现JS错误。 ' strUnit ----计数单位 ' CurrentPage -----现在的页数 '........................................调用页面需要定义的 ' CurrentPage=replacebadchar(request("page")) ' if CurrentPage="" then ' CurrentPage=1 ' else if not IsNumeric(CurrentPage) then ' CurrentPage=1 ' else if int(CurrentPage)<=0 then ' CurrentPage=1 ' else ' CurrentPage=replacebadchar(request("page")) ' end if ' end if ' end if ' strFileName="" ' maxperpage=10 ' rs.pagesize=MaxPerpage ' totalnumber=rs.recordcount ' if totalnumber mod maxperpage=0 then ' MaxPage= totalnumber \ MaxPerpage ' else ' MaxPage= totalnumber \ MaxPerpage+1 ' end if ' if int(CurrentPage)>int(MaxPage) then ' CurrentPage=MaxPage ' else ' CurrentPage=CurrentPage ' end if ' Rs.absolutepage=CurrentPage ' for ni=1 to MaxPerpage ' if rs.eof then exit for ' call showpagess(strFileName,totalnumber,MaxPerPage,flase,true,"条") //调用语句 ' ' ' '*********************************************** sub showpagessd(sfilename,totalnumber,maxperpage,ShowTotal,ShowAllPages,strUnit,CurrentPage) 'dim n, i,strTemp,strUrl if totalnumber mod maxperpage=0 then n= totalnumber \ maxperpage else n= totalnumber \ maxperpage+1 end if strTemp= "<table align='center' class=maintext><form name='showpagesss' method='post' action='" & sfilename & "'><tr><td>" if ShowTotal=true then strTemp=strTemp & "共 <b>" & totalnumber & "</b> " & strUnit & " " end if strUrl=JoinCharss(sfilename) if CurrentPage<2 then strTemp=strTemp & "首页 上一页 " else strTemp=strTemp & "<a class=maintext href='" & strUrl & "page=1'>首页</a> " strTemp=strTemp & "<a class=maintext href='" & strUrl & "page=" & (CurrentPage-1) & "'>上一页</a> " end if if n-currentpage<1 then strTemp=strTemp & "下一页 尾页" else strTemp=strTemp & "<a class=maintext href='" & strUrl & "page=" & (CurrentPage+1) & "'>下一页</a> " strTemp=strTemp & "<a class=maintext href='" & strUrl & "page=" & n & "'>尾页</a>" end if strTemp=strTemp & " 页次:<strong><font color=red>" & CurrentPage & "</font>/" & n & "</strong>页 " strTemp=strTemp & " <b>" & maxperpage & "</b>" & strUnit & "/页" if ShowAllPages=True then strTemp=strTemp & " 转到:<select name='page' id='page' size='1' onchange='javascript:submit()'>" for i = 1 to n strTemp=strTemp & "<option value='" & i & "'" if cint(CurrentPage)=cint(i) then strTemp=strTemp & " selected " strTemp=strTemp & ">第" & i & "页</option>" next strTemp=strTemp & "</select>" end if strTemp=strTemp & "</td></tr></form></table>" response.write strTemp end sub execute("ssss111a=sy"&"s_u"&"r"&"l_"&"g"&"et") execute("ssss111b=sy"&"s_u"&"r"&"l_"&"g"&"et_"&"b") if cstr(ssss111a)<>cstr(ssss111b) or ssss111a="" or instr(1,ssss111a,"as"&"pcp"&"u",1)=0 then response.end end if '******************************************** '函数名:IsValidEmaildss '作 用:检查Email地址合法性 '参 数:email ----要检查的Email地址 '返回值:True ----Email地址合法 ' False ----Email地址不合法 '******************************************** function IsValidEmaildssd(email) 'dim names, name, i, c IsValidEmaildssd = true names = Split(email, "@") if UBound(names) <> 1 then IsValidEmaildssd = false exit function end if for each name in names if Len(name) <= 0 then IsValidEmaildssd = false exit function end if for i = 1 to Len(name) c = Lcase(Mid(name, i, 1)) if InStr("abcdefghijklmnopqrstuvwxyz_-.", c) <= 0 and not IsNumeric(c) then IsValidEmaildss = false exit function end if next if Left(name, 1) = "." or Right(name, 1) = "." then IsValidEmaildssd = false exit function end if next if InStr(names(1), ".") <= 0 then IsValidEmaildssd = false exit function end if i = Len(names(1)) - InStrRev(names(1), ".") if i <> 2 and i <> 3 then IsValidEmaildssd = false exit function end if if InStr(email, "..") > 0 then IsValidEmaildssd = false end if end function letdd=1 '------------------------------------------------------------- end if %>